home *** CD-ROM | disk | FTP | other *** search
- Path: news.iastate.edu!deaven
- From: deaven@ishmael.ameslab.gov (David Deaven)
- Newsgroups: comp.sys.cbm,gnu.gcc.help,comp.sys.atari.8bit
- Subject: Re: GNU C-compiler port to 6502
- Date: 27 Mar 1996 15:20:47 GMT
- Organization: Ames Laboratory, Ames, Iowa
- Message-ID: <4jbmcf$733@news.iastate.edu>
- References: <4irqpb$7pc@esel.cosy.sbg.ac.at>
- NNTP-Posting-Host: ishmael.ameslab.gov
-
- In article <4irqpb$7pc@esel.cosy.sbg.ac.at>,
- Gerhard Wesp <gwesp@cosy.sbg.ac.at> wrote:
- >Is anybody out there by chance working on a gcc port to the 6502?
- >I have found an _lcc_ port, but that seems to produce rather poor assembly
- >for certain C code sequences.
- > I would maybe try to port gcc myself, but only if there are volunteers
- >to assist me ;-)
-
- Yes, I worked a bit on this. What I currently have is not fully
- functional but implements most of the things required for a full
- ANSI compiler. I never anticipated anything but a cross compiler,
- using my workstation to compile code for my herd of Ataris.
-
- Note that there are some choices to be made about whether an
- ``int'' should be 8, 16, or 32 bits long. ANSI requires at least 16,
- and most programmers assume 32. (Before anybody asks, GCC allows you
- to specify any size for all of the basic data types. It is very
- flexible.) More choices for floating point format (I used a switch
- to select Atari 48 bit with assumed AtariOS math functions, or 32/64
- bit with assembler macros that you'd have to supply).
-
- But the biggest choice of all is whether to let GCC manage the 6502
- registers directly, or to use a sort of ``virtual machine'' model on
- the 6502 that looks better to GCC (page zero registers, manipulated by
- simple bits of native code that GCC thinks are single instructions).
- I tried the former, and it was truly amusing to see GCC try to figure
- out how to evaluate complicated expressions using only those 8 bit
- regs. The code was awful! So I think the second route is better.
-
- I'd be willing to help out with this, though my time is limited.
- Perhaps we can get a list of folks together and discuss the basic
- design goals.
-
- Dave
- --
- David Deaven deaven@ishmael.ameslab.gov
- A504 Physics tel 515-294-6878
- Ames Laboratory fax 515-294-0689
- Ames IA 50011 http://www.public.iastate.edu/~deaven
-